package com.reindeer.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.reindeer.common.Result;
import com.reindeer.dto.ProductQueryRequest;
import com.reindeer.dto.ProductVO;
import com.reindeer.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/products")
@RequiredArgsConstructor
@CrossOrigin(origins = "*")
public class ProductController {
    
    private final ProductService productService;

    @PostMapping("/get")
    public Result<Page<ProductVO>> getProducts(@RequestBody ProductQueryRequest request) {
        return Result.success(productService.queryProducts(request));
    }
} 